/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AgendaUI.java
 *
 * Created on 15-abr-2009, 12:10:12
 */
package agenda;

import es.random.agenda.datos.Contacto;
import es.random.java.librerias.gestion.Gestor;
import java.awt.Point;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableModel;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;

/**
 *
 * @author AdminLocal
 */
public class AgendaUI extends javax.swing.JFrame
{

    private int filaAfectada = 0;

    /** Creates new form AgendaUI */
    public AgendaUI()
    {
        initComponents();
        /*gestor = new Gestor<Contacto>();
        gestor.deserializar();
        generarTabla();*/

        TableModel modelo = new ContactoTableModel();
        jTable1.setModel(modelo);
        ListSelectionModel modeloSeleccion = jTable1.getSelectionModel();
        modeloSeleccion.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        modeloSeleccion.addListSelectionListener(new ListSelectionListener()
        {

            public void valueChanged(ListSelectionEvent e)
            {
                int i = jTable1.getSelectedRow();
                if (i >= 0)
                {
                    actualizarDetalle(i);
                }
            }
        });
        validate();
    }

    private void actualizarDetalle(int selectedRow)
    {
        for (int i = 0; i < jTable1.getModel().getColumnCount(); i++)
        {
            switch (i)
            {
                case 0:
                    textoNombre.setText((String) jTable1.getModel().getValueAt(selectedRow, i));
                    break;
                case 1:
                    textoPrimerApellido.setText((String) jTable1.getModel().getValueAt(selectedRow, i));
                    break;
                case 2:
                    textoSegundoApellido.setText((String) jTable1.getModel().getValueAt(selectedRow, i));
                    break;
                case 3:
                    textoTelefonoFijo.setText(((Long) jTable1.getModel().getValueAt(selectedRow, i)).toString());
                    break;
                case 4:
                    textoTelefonoMovil.setText(((Long) jTable1.getModel().getValueAt(selectedRow, i)).toString());
                    break;
                case 5:
                    textoEMail.setText((String) jTable1.getModel().getValueAt(selectedRow, i));
                    break;
                case 6:
                    textoDireccion.setText((String) jTable1.getModel().getValueAt(selectedRow, i));
                    break;
            }
        }
    }

    private void generarTabla()
    {
        jTable1 = new JTable(gestor.obtenerMatriz(), gestor.obtenerNombresColumnas());
        jScrollPane1 = new JScrollPane(jTable1);
        jSplitPane1.setBottomComponent(jScrollPane1);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        menuEmergente = new javax.swing.JPopupMenu();
        elementoMenuAñadir = new javax.swing.JMenuItem();
        elementoMenuBorrar = new javax.swing.JMenuItem();
        jSplitPane1 = new javax.swing.JSplitPane();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        textoNombre = new javax.swing.JTextField();
        textoPrimerApellido = new javax.swing.JTextField();
        textoSegundoApellido = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        textoTelefonoFijo = new javax.swing.JTextField();
        textoTelefonoMovil = new javax.swing.JTextField();
        textoEMail = new javax.swing.JTextField();
        textoDireccion = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        elementoMenuAñadir.setText("Añadir Contacto");
        elementoMenuAñadir.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                elementoMenuAñadirMouseReleased(evt);
            }
        });
        menuEmergente.add(elementoMenuAñadir);

        elementoMenuBorrar.setText("Borrar Contacto");
        elementoMenuBorrar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                elementoMenuBorrarMouseReleased(evt);
            }
        });
        menuEmergente.add(elementoMenuBorrar);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                formMousePressed(evt);
            }
        });
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
        });

        jSplitPane1.setDividerLocation(175);
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jPanel2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jPanel2MouseReleased(evt);
            }
        });

        jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jTree1MouseReleased(evt);
            }
        });
        jScrollPane2.setViewportView(jTree1);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(48, 48, 48)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                .addGap(25, 25, 25))
        );

        jTabbedPane1.addTab("tab2", jPanel2);

        jLabel1.setText("Nombre:");

        jLabel2.setText("Primer Apellido:");

        jLabel3.setText("Segundo Apellido:");

        textoNombre.setName("0"); // NOI18N
        textoNombre.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        textoPrimerApellido.setName("1"); // NOI18N
        textoPrimerApellido.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        textoSegundoApellido.setName("2"); // NOI18N
        textoSegundoApellido.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        jLabel4.setText("Teléfono Fijo:");

        jLabel5.setText("Teléfono Móvil:");

        jLabel6.setText("E-Mail:");

        jLabel7.setText("Dirección:");

        textoTelefonoFijo.setName("3"); // NOI18N
        textoTelefonoFijo.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        textoTelefonoMovil.setName("4"); // NOI18N
        textoTelefonoMovil.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        textoEMail.setName("5"); // NOI18N
        textoEMail.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        textoDireccion.setName("6"); // NOI18N
        textoDireccion.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                textoNombreFocusLost(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(textoSegundoApellido)
                            .addComponent(textoPrimerApellido)
                            .addComponent(textoNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addComponent(jLabel4))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(textoEMail)
                            .addComponent(textoTelefonoMovil)
                            .addComponent(textoTelefonoFijo, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(18, 18, 18)
                        .addComponent(textoDireccion, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textoNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textoPrimerApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addGap(11, 11, 11)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(textoSegundoApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textoTelefonoFijo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textoTelefonoMovil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textoEMail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(textoDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Contactos", jPanel1);

        jSplitPane1.setTopComponent(jTabbedPane1);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jTable1MouseReleased(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jTable1MouseReleased(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jSplitPane1.setRightComponent(jScrollPane1);

        jMenu1.setText("File");

        jMenuItem1.setText("Guardar Agenda");
        jMenuItem1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem1MouseReleased(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem2.setText("Cargar Agenda");
        jMenuItem2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem2MouseReleased(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowActivated(java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowActivated
    {//GEN-HEADEREND:event_formWindowActivated
        // TODO add your handling code here:
    }//GEN-LAST:event_formWindowActivated

    private void formMousePressed(java.awt.event.MouseEvent evt)//GEN-FIRST:event_formMousePressed
    {//GEN-HEADEREND:event_formMousePressed
        // TODO add your handling code here:
    }//GEN-LAST:event_formMousePressed

    private void textoNombreFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_textoNombreFocusLost
    {//GEN-HEADEREND:event_textoNombreFocusLost

        String contenido = ((JTextField) evt.getSource()).getText();
        int campo = Integer.parseInt(((JTextField) evt.getSource()).getName());
        int registro = jTable1.getSelectedRow();
        Object valorTabla = jTable1.getModel().getValueAt(registro, campo);
        String cadenaTabla = "";
        if (valorTabla instanceof String)
        {
            cadenaTabla = (String) valorTabla;
        } else
        {
            cadenaTabla = ((Long) valorTabla).toString();
        }
        if (!(contenido.equals(cadenaTabla)))
        {
            jTable1.getModel().setValueAt(contenido, registro, campo);
        }
        jTable1.repaint();
    }//GEN-LAST:event_textoNombreFocusLost

    private void elementoMenuAñadirMouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_elementoMenuAñadirMouseReleased
    {//GEN-HEADEREND:event_elementoMenuAñadirMouseReleased
        ((ContactoTableModel) jTable1.getModel()).añadirContacto();
        jTable1.repaint();
        jTable1.addRowSelectionInterval(jTable1.getRowCount() - 1, jTable1.getRowCount() - 1);
    }//GEN-LAST:event_elementoMenuAñadirMouseReleased

    private void elementoMenuBorrarMouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_elementoMenuBorrarMouseReleased
    {//GEN-HEADEREND:event_elementoMenuBorrarMouseReleased

        ((ContactoTableModel) jTable1.getModel()).borrarContacto(filaAfectada);
    }//GEN-LAST:event_elementoMenuBorrarMouseReleased

    private void jTable1MouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jTable1MouseReleased
    {//GEN-HEADEREND:event_jTable1MouseReleased
        filaAfectada = jTable1.rowAtPoint(evt.getPoint());
        jTable1.addRowSelectionInterval(filaAfectada, filaAfectada);
        if(evt.isPopupTrigger())
        {
        menuEmergente.setLocation(evt.getLocationOnScreen().x-5, evt.getLocationOnScreen().y-5);
        menuEmergente.requestFocus();
        menuEmergente.addMouseListener(new MouseAdapter() {

                @Override
            public void mouseExited(MouseEvent e)
            {
                menuEmergente.setVisible(false);
            }
        });
        menuEmergente.setVisible(true);
        }
    }//GEN-LAST:event_jTable1MouseReleased

    private void jMenuItem1MouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jMenuItem1MouseReleased
    {//GEN-HEADEREND:event_jMenuItem1MouseReleased
        ((ContactoTableModel) jTable1.getModel()).guardarCambios();
    }//GEN-LAST:event_jMenuItem1MouseReleased

    private void jMenuItem2MouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jMenuItem2MouseReleased
    {//GEN-HEADEREND:event_jMenuItem2MouseReleased
        ((ContactoTableModel) jTable1.getModel()).cargarAgenda();
    }//GEN-LAST:event_jMenuItem2MouseReleased

    private void jPanel2MouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jPanel2MouseReleased
    {//GEN-HEADEREND:event_jPanel2MouseReleased
        TreeNode nodoRaiz = (TreeNode) this.jTree1.getModel().getRoot();

        nodoRaiz = ((ContactoTableModel) jTable1.getModel()).obtenerDatosArbol();
        jTree1.repaint();

    }//GEN-LAST:event_jPanel2MouseReleased

    private void jTree1MouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jTree1MouseReleased
    {//GEN-HEADEREND:event_jTree1MouseReleased
        TreeNode nodoRaiz = (TreeNode) this.jTree1.getModel().getRoot();

        nodoRaiz = ((ContactoTableModel) jTable1.getModel()).obtenerDatosArbol();
        jTree1.repaint();

    }//GEN-LAST:event_jTree1MouseReleased

    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        java.awt.EventQueue.invokeLater(new Runnable()
        {

            public void run()
            {
                new AgendaUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem elementoMenuAñadir;
    private javax.swing.JMenuItem elementoMenuBorrar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTree jTree1;
    private javax.swing.JPopupMenu menuEmergente;
    private javax.swing.JTextField textoDireccion;
    private javax.swing.JTextField textoEMail;
    private javax.swing.JTextField textoNombre;
    private javax.swing.JTextField textoPrimerApellido;
    private javax.swing.JTextField textoSegundoApellido;
    private javax.swing.JTextField textoTelefonoFijo;
    private javax.swing.JTextField textoTelefonoMovil;
    // End of variables declaration//GEN-END:variables
    private Gestor<Contacto> gestor;
}
